package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 教材库存表
 * @TableName textbook_inventory
 */
@TableName(value ="textbook_inventory")
@Data
public class TextbookInventory {
    /**
     * 库存ID
     */
    @TableId(type = IdType.AUTO)
    private Long inventoryId;

    /**
     * 教材ID
     */
    private Long textbookId;

    /**
     * 当前库存
     */
    private Integer currentStock;

    /**
     * 库存预警阈值
     */
    private Integer alertThreshold;

    /**
     * 最低需求量
     */
    private Integer minRequired;

    /**
     * 在途数量
     */
    private Integer incomingQuantity;

    /**
     * 待出库数量
     */
    private Integer outgoingQuantity;

    /**
     * 最后盘点日期
     */
    private Date lastInventoryDate;

    /**
     * 库存位置
     */
    private String warehouseLocation;

    /**
     * 库存状态
     */
    private Object status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TextbookInventory other = (TextbookInventory) that;
        return (this.getInventoryId() == null ? other.getInventoryId() == null : this.getInventoryId().equals(other.getInventoryId()))
            && (this.getTextbookId() == null ? other.getTextbookId() == null : this.getTextbookId().equals(other.getTextbookId()))
            && (this.getCurrentStock() == null ? other.getCurrentStock() == null : this.getCurrentStock().equals(other.getCurrentStock()))
            && (this.getAlertThreshold() == null ? other.getAlertThreshold() == null : this.getAlertThreshold().equals(other.getAlertThreshold()))
            && (this.getMinRequired() == null ? other.getMinRequired() == null : this.getMinRequired().equals(other.getMinRequired()))
            && (this.getIncomingQuantity() == null ? other.getIncomingQuantity() == null : this.getIncomingQuantity().equals(other.getIncomingQuantity()))
            && (this.getOutgoingQuantity() == null ? other.getOutgoingQuantity() == null : this.getOutgoingQuantity().equals(other.getOutgoingQuantity()))
            && (this.getLastInventoryDate() == null ? other.getLastInventoryDate() == null : this.getLastInventoryDate().equals(other.getLastInventoryDate()))
            && (this.getWarehouseLocation() == null ? other.getWarehouseLocation() == null : this.getWarehouseLocation().equals(other.getWarehouseLocation()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getInventoryId() == null) ? 0 : getInventoryId().hashCode());
        result = prime * result + ((getTextbookId() == null) ? 0 : getTextbookId().hashCode());
        result = prime * result + ((getCurrentStock() == null) ? 0 : getCurrentStock().hashCode());
        result = prime * result + ((getAlertThreshold() == null) ? 0 : getAlertThreshold().hashCode());
        result = prime * result + ((getMinRequired() == null) ? 0 : getMinRequired().hashCode());
        result = prime * result + ((getIncomingQuantity() == null) ? 0 : getIncomingQuantity().hashCode());
        result = prime * result + ((getOutgoingQuantity() == null) ? 0 : getOutgoingQuantity().hashCode());
        result = prime * result + ((getLastInventoryDate() == null) ? 0 : getLastInventoryDate().hashCode());
        result = prime * result + ((getWarehouseLocation() == null) ? 0 : getWarehouseLocation().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", inventoryId=").append(inventoryId);
        sb.append(", textbookId=").append(textbookId);
        sb.append(", currentStock=").append(currentStock);
        sb.append(", alertThreshold=").append(alertThreshold);
        sb.append(", minRequired=").append(minRequired);
        sb.append(", incomingQuantity=").append(incomingQuantity);
        sb.append(", outgoingQuantity=").append(outgoingQuantity);
        sb.append(", lastInventoryDate=").append(lastInventoryDate);
        sb.append(", warehouseLocation=").append(warehouseLocation);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}